package com.zzb.projectfactory.framework.role.dao;

import com.zzb.projectfactory.framework.role.dao.jpa.SysMenuRepository;
import com.zzb.projectfactory.framework.role.dao.mybatis.SysMenuMapper;
import com.zzb.projectfactory.framework.role.entity.SysMenu;
import com.zzb.projectfactory.framework.common.BaseDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 菜单表 Dao接口
 */
@Repository
public class SysMenuDAO extends BaseDAO<SysMenu,SysMenuRepository> {
    @Autowired
    private SysMenuRepository menuRepository;
    @Autowired
    private SysMenuMapper sysMenuMapper;
    @Override
    public SysMenuRepository getRepository() { return menuRepository; }

    public List<SysMenu> listByUserId(String userId){
        return sysMenuMapper.listByUserId(userId);
    }

    public List<SysMenu> listByRoleId(String roleId){
        return sysMenuMapper.listByRoleId(roleId);
    }
}
